package com.example.springbootintegration.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class Task {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

    //@Scheduled(fixedRate = 1000)
   // @Scheduled(cron="*/1 * * * * ?")
    public void taskOne(){
        System.out.println("现在时间：" + dateFormat.format(new Date()));
    }
}